package org.yyf.resource.demo.mybatis.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.yyf.resource.demo.mybatis.entity.User;
import org.yyf.resource.intercepter.SqlChange;

@Mapper
public interface UserMapper {
	@SqlChange
	@Select("select * from user where id = #{id}")
	User get(String id);
	
	@Update("update user set name = #{name},email = #{email} where id = #{id}")
	void update(User user);
	
	@Insert("insert into user values(#{id},#{name},#{email})")
	void insert(User user);
	
	@Delete("delete from user where id = #{id}")
	void delete(String id);
}
